package com.java.demo.component;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanLifeTest {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
        BeanComponent component = context.getBean("beanComponent",BeanComponent.class);
        component.sayHi();
        context.close();
    }
}
